interface ListFilterItem{
    name?:string,
    text?:string,
    visible:boolean
}
interface IListFilterScope extends ng.IScope {
    // 车辆ID；
    queryTermsFilterList:ListFilterItem[];
    tabHeadFilterList:ListFilterItem[];
    setQuery:boolean;
    handleQueryTermChange:(e)=>void;
    handTabHeadChange:(e)=>void;
    queryTermsFilter:(e)=>void;
    tabHeadFilter:(e)=>void;
    visible:boolean;
    toggle:()=>void;
}


function tmsListFilter($ngBootbox: BootboxService): ng.IDirective {
    return {
       
        restrict: 'E',
        templateUrl: './src/directives/tms-list-filter/tms-list-filter.html',
        transclude: true,
        scope: {

            queryTermsFilterList: "=",
            tabHeadFilterList: "=",
            tabHeadFilter:'&'
            
        },
        link: ($scope: IListFilterScope) => {
            $scope.visible=false;
            $scope.setQuery=true;

            $scope.handTabHeadChange=(e)=>{
                $scope.tabHeadFilter({item:e})
            }

            $scope.toggle=()=>{
                $scope.visible=!$scope.visible;
            }
          
         
        }

    }
}


tmsListFilter['$inject'] = ["$ngBootbox"]
angular.module('tmsListFilter', []).directive('tmsListFilter', tmsListFilter);